package game.actor
{
	import engine.asset.*;
	import engine.core.*;
	//import game.messages.gamedata.*;
	import game.messages.inventory.*;
	import game.network.*;
	import game.scene.*;
	import game.ui.core.*;
	
	public class RxInventory
	{
		private var m_inventory:Vector.<RxItemRecord>;
		private var m_length:uint = 0;
		private var m_capacity:uint = 0;
		private var m_receivedUpdateMessage:Boolean = false;
		private var m_numNewItems:uint;
		public static const ITEM_COMPARE_BETTER:int = 1;
		public static const ITEM_COMPARE_EQUAL:int = 0;
		public static const ITEM_COMPARE_WORSE:int = -1;
		public static const ITEM_COMPARE_INVALID:int = -2;
		private static var s_initialized:Boolean = false;
		private static var s_slotLabels:Array;
		private static var s_playerInventories:Array = new Array();
		private static var s_slotMap:Object = new Object();
		
		public function RxInventory()
		{
			this.m_inventory = new Vector.<RxItemRecord>;
			this.m_inventory.length = RxInventory_ItemDescription.LOCATION_MAX;
			this.Initialize();
		}
		
		private function Initialize() : void
		{
			if (!s_initialized)
			{
				s_initialized = true;
				s_slotLabels = [];
				s_slotLabels[RxInventory_ItemDescription.LOCATION_HEAD] = "Head";
				s_slotLabels[RxInventory_ItemDescription.LOCATION_BODY] = "Chest";
				s_slotLabels[RxInventory_ItemDescription.LOCATION_HAND_PRIMARY] = "Weapon";
				s_slotLabels[RxInventory_ItemDescription.LOCATION_HANDS] = "Gloves";
				s_slotLabels[RxInventory_ItemDescription.LOCATION_CHARM_1] = "Left Charm";
				s_slotLabels[RxInventory_ItemDescription.LOCATION_CHARM_2] = "Right Charm";
				s_slotLabels[RxInventory_ItemDescription.LOCATION_NECK] = "Neck";
				s_slotLabels[RxInventory_ItemDescription.LOCATION_SHOULDERS] = "Shoulders";
				s_slotLabels[RxInventory_ItemDescription.LOCATION_HAND_SECONDARY] = "Offhand";
				s_slotLabels[RxInventory_ItemDescription.LOCATION_FEET] = "Feet";
				s_slotLabels[RxInventory_ItemDescription.LOCATION_FINGER_1] = "Left Ring";
				s_slotLabels[RxInventory_ItemDescription.LOCATION_FINGER_2] = "Right Ring";
			}
		}
		
		public static function GetLabelColorForItem(param1:String) : uint
		{
			/*
			if (!IsItemLoaded(param1))
			{
				return 16777215;
			}
			var _loc_2:* = RxAssetCSV.GetByName(RxGameData_NameSpace.ITEM);
			var _loc_3:* = _loc_2.GetMappedString("quality", param1);
			var _loc_4:* = RxAssetCSV.GetByName("itemquality");
			var _loc_5:* = RxAssetCSV.GetByName("itemquality").GetMappedUInt("color", _loc_3);
			return RxAssetCSV.GetByName("itemquality").GetMappedUInt("color", _loc_3);*/
			
			return 0;
		}
	}
}